package com.sgb.kjwl.view.ui.adapter.home;

import android.content.Context;
import android.view.View;
import android.widget.TextView;

import com.sgb.kjwl.BR;
import com.sgb.kjwl.R;
import com.sgb.jicai.entity.CentralizedMiningEntity;
import com.sgb.kjwl.view.ui.activity.manage.ShopInfoForCompanyTradesActivity;
import com.swgk.core.recyclerview.adapter.BaseRecycleAdapter;
import com.swgk.core.recyclerview.adapter.ItemViewHolder;

import java.util.List;

public class CentralizedMiningAdapter extends BaseRecycleAdapter<CentralizedMiningEntity> {

    public CentralizedMiningAdapter(Context context, List<CentralizedMiningEntity> datas) {
        super(context, R.layout.item_centralized_mining, datas);
    }

    @Override
    public void convert(ItemViewHolder holder, final CentralizedMiningEntity entity) {
        holder.setBinding(BR.viewModel, entity);
        TextView ent = holder.itemView.findViewById(R.id.ent);

        ent.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                ShopInfoForCompanyTradesActivity.startAct(context, entity.getSupplierId(), "", 0, 0);
            }
        });
    }
}
